﻿//=====================================================
// Copyright © 2017-2018 xuxuzhaozhao
// All rights reserved
// GUID: 995f7826-e7ef-4d08-9667-b66b2c2da4e3
// CLR版本: 4.0.30319.42000
// 命名空间名称: xuxuzhaozhao.Blog.Infrastructure
// 文件名: XuxuzhaozhaoDbInitializer
// 当前系统时间: 2017/11/6 17:17:15
// 当前登录用户名: xuxuzhaozhao
//======================================================

using System.Data.Entity;
using xuxuzhaozhao.Blog.Domain;

namespace xuxuzhaozhao.Blog.Infrastructure.XuEntityFramework
{
    public class XuxuzhaozhaoDbInitializer : DropCreateDatabaseIfModelChanges<XuxuzhaozhaoDbContext>
    {
        protected override void Seed(XuxuzhaozhaoDbContext context)
        {
            var xuxu = new XuUser()
            {
                UserName = "xuxuzhaozhao",
                Password = "123",
                Phone = "18200394452",
                RealName = "徐程意",
            };

            var zhaozhao = new XuUser()
            {
                UserName = "zhaozhaoxuxu",
                Password = "123",
                Phone = "18200394447",
                RealName = "赵燕"
            };

            context.XuUser.Add(xuxu);
            context.XuUser.Add(zhaozhao);

            context.SaveChanges();
        }
    }
}
